# -*- coding: iso-8859-2 -*-

from authorshipanalyzer.textutils import Splitter

class Slot:
    '''
    Slot for a single message
    Attributes:
    @param message
    @param author
    
    Content features:
    @param category: category of message
    
    Email structure features:
    @param requotation type
    @param greeting
    @param text
    @param farewell
    @param signature
    @param hasAdvert
    @param useDiacritics
    
    Profile features:
    @param age
    @param sex
    @param status
        
    Stylometric document based features (starts with 'd'):
    @param dSentences: number of sentences / number of statements
    
    @param wordFrequency: dict<word_basic_form, frequency> extracted from slot.message.text
    @param contentWordFrequency: dict<content_word_basic_form, frequency> extracted from slot.text
    '''

    def __init__(self):
        self.message = None
        
        self.category = []
        
        self.age = []
        self.status = []
        self.sex = "unknown"

        self.requotationType = 0
        self.greeting = ""
        self.text = ""
        self.farewell = ""
        self.signature = ""
        self.hasAdvert = False
        self.useDiacritics = None
        
        self.dSentences = 0.0
        
        self.wordFrequency = {}
        self.contentWordFrequency = {}

    def getContentWordFrequency(self):
        return self.__contentWordFrequency


    def setContentWordFrequency(self, value):
        self.__contentWordFrequency = value


    def getDSentences(self):
        return self.__dSentences


    def setDSentences(self, value):
        self.__dSentences = value


    def getText(self):
        return self.__text


    def setText(self, value):
        self.__text = value


    def getHasAdvert(self):
        return self.__hasAdvert


    def setHasAdvert(self, value):
        self.__hasAdvert = value


    def getAuthor(self):
        return self.message.getAuthor()


    def setAuthor(self, value):
        self.message.setAuthor(value)


    def getWordFrequency(self):
        return self.__wordFrequency


    def getCategory(self):
        return self.__category


    def getAge(self):
        return self.__age


    def getSex(self):
        return self.__sex


    def getStatus(self):
        return self.__status


    def getRequotationType(self):
        return self.__requotationType


    def getGreeting(self):
        return self.__greeting


    def getFarewell(self):
        return self.__farewell


    def getSignature(self):
        return self.__signature


    def getUseDiacritics(self):
        return self.__useDiacritics


    def getMessage(self):
        return self.__message


    def setWordFrequency(self, value):
        self.__wordFrequency = value


    def setCategory(self, value):
        self.__category = value


    def setAge(self, value):
        self.__age = value


    def setSex(self, value):
        self.__sex = value


    def setStatus(self, value):
        self.__status = value


    def setRequotationType(self, value):
        self.__requotationType = value


    def setGreeting(self, value):
        self.__greeting = value


    def setFarewell(self, value):
        self.__farewell = value


    def setSignature(self, value):
        self.__signature = value


    def setUseDiacritics(self, value):
        self.__useDiacritics = value


    def setMessage(self, value):
        self.__message = value

    wordFrequency = property(getWordFrequency, setWordFrequency, None, None)
    
    category = property(getCategory, setCategory, None, None)
    
    age = property(getAge, setAge, None, None)
    sex = property(getSex, setSex, None, None)
    status = property(getStatus, setStatus, None, None)
    
    message = property(getMessage, setMessage, None, None)
    author = property(getAuthor, setAuthor, None, None)
    
    useDiacritics = property(getUseDiacritics, setUseDiacritics, None, None)
    requotationType = property(getRequotationType, setRequotationType, None, None)
    
    greeting = property(getGreeting, setGreeting, None, None)
    text = property(getText, setText, None, None)
    farewell = property(getFarewell, setFarewell, None, None)
    signature = property(getSignature, setSignature, None, None)
    hasAdvert = property(getHasAdvert, setHasAdvert, None, None)
    

    dSentences = property(getDSentences, setDSentences, None, None)

    contentWordFrequency = property(getContentWordFrequency, setContentWordFrequency, None, None)
